class Sale < ActiveRecord::Base
  belongs_to :product
  belongs_to :client
  
  validates_associated :client
  validates_associated :product
  
  validates_presence_of :client
  validates_presence_of :product
  
  validates_presence_of :price
  validates_numericality_of :price
  validates_positiveness_of :price
  
  validates_presence_of :quantity
  validates_numericality_of :quantity
  validates_positiveness_of :quantity
  
  validates_presence_of :date
end
